)>
Defined in Type: PlatformBitmapLoaderSplat
Assembly: Splat.Drawing.dll
Applies to
net10.0-android36.0
public PlatformBitmapLoader(Func<string, int> drawableResolver)
Summary: Initializes a new instance of the PlatformBitmapLoader class.
Parameters
| Name | Type | Description |
|---|---|---|
drawableResolver | Func | A function that maps drawable names to resource IDs. Use a switch expression for AOT-friendly compile-time mapping. |
Examples
var loader = new PlatformBitmapLoader<Resource.Drawable>(name => name switch
{
"icon" => Resource.Drawable.icon,
"logo" => Resource.Drawable.logo,
_ => 0 // Return 0 for unknown resources
});